package com.thinkcube.edutainment.client;

import org.androidannotations.annotations.rest.Accept;
import org.androidannotations.annotations.rest.Post;
import org.androidannotations.annotations.rest.Rest;
import org.androidannotations.api.rest.MediaType;
import org.springframework.http.converter.FormHttpMessageConverter;
import org.springframework.http.converter.StringHttpMessageConverter;
import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter;
import org.springframework.util.MultiValueMap;
import org.springframework.web.client.RestClientException;

import com.thinkcube.edutainment.EdutainmentConstant;
import com.thinkcube.edutainment.domain.CourseWork;
import com.thinkcube.edutainment.domain.MetaData;
import com.thinkcube.edutainment.domain.OAuth;
import com.thinkcube.edutainment.domain.Question;
import com.thinkcube.edutainment.domain.Todo;
import com.thinkcube.edutainment.domain.User;

/**
 * shanuka gayashan @Cyberlmj 2:06:25 AM Email: shanuka.gayashan@cyberlmj.com
 */
@Rest(rootUrl = EdutainmentConstant.ROOT_URL, converters = {
		FormHttpMessageConverter.class, StringHttpMessageConverter.class,
		MappingJackson2HttpMessageConverter.class } ,interceptors = { ThinkcubeInterceptor.class })
public interface UserClient {

	@Post("/api/user/create")
	@Accept(MediaType.APPLICATION_JSON)
	User signUpNewUser(MultiValueMap formfields) throws RestClientException;

	@Post("/api/auth/request-token")
	@Accept(MediaType.APPLICATION_JSON)
	OAuth getRequestToken(MultiValueMap formfields) throws RestClientException;

	@Post("/api/user/get-profile")
	@Accept(MediaType.APPLICATION_JSON)
	User getUserProfileInformation(MultiValueMap formfields)
			throws RestClientException;

	@Post("/api/user/return-to-app")
	@Accept(MediaType.APPLICATION_JSON)
	String getSystemUser() throws RestClientException;
	
	@Post("/api/user/make-login")
	@Accept(MediaType.APPLICATION_JSON)
	String getMakeUser(MultiValueMap formfields) throws RestClientException;
	

	@Post("/api/user/get-todo-list")
	@Accept(MediaType.APPLICATION_JSON)
	Todo getTodo(MultiValueMap formfields) throws RestClientException;
	
	@Post("/api/user/get-course-works")
	@Accept(MediaType.APPLICATION_JSON)
	CourseWork getCourseWork(MultiValueMap formfields) throws RestClientException;
	
	@Post("/api/user/update-profile")
	@Accept(MediaType.APPLICATION_JSON)
	MetaData update(MultiValueMap formfields) throws RestClientException;
	
	
	
	@Post("/api/course/get-questions")
	@Accept(MediaType.APPLICATION_JSON)
	Question getQuestion(MultiValueMap formfields) throws RestClientException;
}
